package ch.penas.web;

import java.io.Serializable;
import javax.faces.bean.ApplicationScoped;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

import org.apache.log4j.Logger;

import ch.penas.business.dom.Agenda;
import ch.penas.business.service.AgendaService;
import ch.penas.business.service.AgendaServiceImpl;

/** @author Daniel */
@ManagedBean(name = "manageBeanAgenda")
@ViewScoped
public final class ManageBeanAgenda implements Serializable {

	private static final long serialVersionUID = 7821547244981771579L;

	private static final Logger LOGGER = Logger .getLogger(ManageBeanAgenda.class);

	private Agenda mAgenda;

	private AgendaService mService;
	
	public ManageBeanAgenda() {
		this.mService = new AgendaServiceImpl();
		this.mAgenda = new Agenda();
	}
	
	public String addEvent() {
        this.mService.addEvent(this.mAgenda);
        return "successAgenda";
    }

	// Getter et setter de service
	public AgendaService getService() {
		return mService;
	}
	public void setService(AgendaService mService) {
		this.mService = mService;
	}
	
	// Getter et setter de agenda
	public Agenda getAgenda() {
		return mAgenda;
	}
	public void setAgenda(Agenda mAgenda) {
		this.mAgenda = mAgenda;
	}
}